import java.util.*;


public class ArrayListTest {

  public static void main(String[] args) {
    ArrayList<Employee> staff = new ArrayList<>();
    staff.add(new Employee("Carl Cracker", 75000, 1987, 12, 15));
    staff.add(new Employee("Harry Hacker", 50000, 1989, 10, 1));
    staff.add(new Employee("Tony Tester", 40000, 1990, 3, 15));

    for (Employee e : staff) {
      e.raiseSalary(5);
    }

    for (Employee e : staff) {
      System.out.print(e);
    }
  }

}


class Employee {

  private String name;
  private double salary;
  private Date hireDay;


  public Employee(String name, double salary, int year, int month, int day) {
    this.name = name;
    this.salary = salary;
    this.hireDay = new GregorianCalendar(year, month - 1, day).getTime();
  }


  public String getName() {
    return this.name;
  }


  public double getSalary() {
    return this.salary;
  }


  public void raiseSalary(double percent) {
    this.salary *= (1 + percent / 100);
  }


  public String toString() {
    StringBuilder builder = new StringBuilder();
    builder.append("name=");
    builder.append(this.name);
    builder.append(",salary=");
    builder.append(this.salary);
    builder.append(",hireday=");
    builder.append(this.hireDay);
    builder.append("\n");

    return builder.toString();
  }
}
